Skip to content

Add native backend support for Mac#1333

Merged
tustanivsky merged 10 commits intomainfrom
feat/native-backend-mac
Apr 15, 2026
Merged

Add native backend support for Mac#1333
tustanivsky merged 10 commits intomainfrom
feat/native-backend-mac

Conversation

@tustanivsky
Copy link
Copy Markdown
Collaborator

@tustanivsky tustanivsky commented Apr 7, 2026

This PR adds opt-in support for the sentry-native backend on macOS. When enabled, macOS uses the same sentry-native (GenericPlatform) implementation as Windows and Linux instead of the default sentry-cocoa SDK. This also enables the external crash reporter on macOS, which requires the native backend.

Key Changes

  • Reuse GenericPlatform (sentry-native) implementation on macOS when the native backend is enabled via a conditional base class in MacSentrySubsystem
  • Add #if !USE_SENTRY_NATIVE guards to Apple source/header files and SentryModule to exclude the Cocoa implementation when the native backend is active
  • Update Sentry.Build.cs to link required libraries (libsentry, libcurl, nghttp2, OpenSSL)
  • Configure CA certificates for curl transport on macOS
  • Reorganize the macOS ThirdParty directory into Cocoa/ and Native/ subdirectories
  • Add CI jobs for building sentry-native and the crash reporter on macOS
  • Update download and packaging scripts
  • Disable hang tracking on macOS native backend due to SIGUSR2 conflict with Unreal Engine’s cross-thread stack capture
  • Update integration tests for native backend detection and macOS-specific skip conditions

Known limitations

  • App Sandbox blocks native's backend IPC semaphores in packaged game builds causing initialization to fail (requires disabling com.apple.security.app-sandbox entitlement)
  • Hang tracking is currently not supported on Mac with native backend enabled

Documentation

Related items:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • Prevent potential script injection in crash-reporter-build workflow by fix-it-felix-sentry in #1324

Internal Changes 🔧

Deps

  • Update Native SDK to v0.13.6 by github-actions in #1339
  • Update Android Gradle Plugin to v6.4.0 by github-actions in #1338
  • Update Cocoa SDK to v9.10.0 by github-actions in #1335
  • Update Java SDK to v8.38.0 by github-actions in #1336
  • Update Native SDK to v0.13.5 by github-actions in #1334
  • Update Cocoa SDK to v9.9.0 by github-actions in #1332
  • Update CLI to v3.3.5 by github-actions in #1323

Other

  • Update validate-pr workflow by stephanie-anderson in #1328

Other

  • Add native backend support for Mac by tustanivsky in #1333
  • Fix intermittent crash when capturing screenshots due to invalid viewport by tustanivsky in #1331
  • Suppress superfluous warnings when detecting for SteamOS by yangskyboxlabs in #1326
  • Add out-of-process screenshot capturing on Windows by tustanivsky in #1325

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 6a9cee9

Copy link
Copy Markdown
Member

@JoshuaMoelans JoshuaMoelans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


It "Should have overridden release" -Skip:($Platform -eq 'MacOS') {
It "Should have overridden release" -Skip:($Platform -eq 'MacOS' -and -not $IsNativeBackend) {
$script:MessageEvent.release.version | Should -Be 'test-release@1.0.0'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the release formatted in a different way?

#if PLATFORM_ANDROID
#include "Android/AndroidSentryAttachment.h"
#elif PLATFORM_APPLE
#elif PLATFORM_APPLE && !USE_SENTRY_NATIVE
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, one could move USE_SENTRY_NATIVE above to get away with fewer conditions? even though this variant is more explicit and might be even easier to read. sorry for a useless comment, feel free to ignore... 🙃

@tustanivsky tustanivsky merged commit c00f32b into main Apr 15, 2026
156 of 158 checks passed
@tustanivsky tustanivsky deleted the feat/native-backend-mac branch April 15, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants